/**
 * 作者：陈文斌 on 2019/1/12.
 * 邮箱：chen_wennbin@163.com
 * 版本：v1.0
 */

import 'package:flutter/material.dart';
import 'package:crm/constant/constant.dart';

class RefreshFooterNormal extends StatelessWidget {
  final bool isMore;
  final double fontSize;
  final double indicatorSize;

  RefreshFooterNormal({
    Key key,
    @required this.isMore,
    this.fontSize = AppFontSizes.Font14,
    this.indicatorSize = 14
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final _textStyle = TextStyle(
      color: AppColors.TextColor,
      fontSize: fontSize,
      fontFamily: AppFontFamilies.PingFangSC,
    );

    return Center(
      child: Padding(
        padding: EdgeInsets.all(10.0),
        child: isMore
            ? Row(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  Text(
                    '数据加载中',
                    style: _textStyle,
                  ),
                  Container(
                    width: indicatorSize,
                    height: indicatorSize,
                    margin: EdgeInsets.only(left: 10),
                    child: CircularProgressIndicator(
                      strokeWidth: 1.0,
                    ),
                  ),
                ],
              )
            : Text(
                '没有更多数据',
                style: _textStyle,
              ),
      ),
    );
  }
}
